package com.zs.zcerp.approval.controller;

import com.zs.zcerp.approval.entity.QhChkmgrmEntity;
import com.zs.zcerp.approval.service.IQhChkmgrmService;
import com.zs.zcerp.common.controller.BaseController;
import com.zs.zcerp.common.entity.FebsResponse;
import com.zs.zcerp.common.entity.QueryRequest;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 签核主表
 * @author Henry
 * @email *****@mail.com
 * @date 2021-04-28 20:58:44
 */
@Slf4j
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("history")
public class QhChkmgrmController extends BaseController {

    private final IQhChkmgrmService iQhChkmgrmService;

    @GetMapping("list")
    @RequiresPermissions("history:view")
    public FebsResponse signList(QhChkmgrmEntity qhChkmgrmEntity, QueryRequest request) {
        if(qhChkmgrmEntity.getOrderNo()!=null){
            qhChkmgrmEntity.setOrderNo(qhChkmgrmEntity.getOrderNo().trim());
        }
        return new FebsResponse().success()
                .data(getDataTable(iQhChkmgrmService.signList(qhChkmgrmEntity, request)));
    }






}
